Minor driver code changes/rearrangement to reduce ia64-specific patches
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Fri, 4 Nov 2005 16:40:29 +0000 (10:40 -0600)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Fri, 4 Nov 2005 16:40:29 +0000 (10:40 -0600)
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>

linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/console.c.patch
linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/devmem.c.patch
linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch
linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/privcmd.c.patch
linux-2.6-xen-sparse/arch/xen/kernel/devmem.c
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
linux-2.6-xen-sparse/drivers/xen/console/console.c
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
linux-2.6-xen-sparse/include/asm-xen/asm-ia64/fixmap.h
linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h

index d9b30e633bc406f7a460306ef9587f4992fa93f0..71d655d4fd5522d4a9aed10e6e3271e88aa8fbc6 100644 (file)
@@ -1,15 +1,5 @@
 --- xen/console/console.c      2005-11-02 14:13:07.000000000 +0100
 +++ xen.patched/console/console.c      2005-11-02 14:21:20.000000000 +0100
-@@ -196,6 +196,9 @@
- void xen_console_init(void)
- #endif
- {
-+      if (xen_init() < 0)
-+              return __RETCODE;
-+
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
-               if (xc_mode == XC_DEFAULT)
-                       xc_mode = XC_SERIAL;
 @@ -768,9 +771,15 @@
  #endif
  
index ec6e9b3c8385b6d4bfce2e858d646caad535cbd4..924296442e29ab29b3e5c8ac8f9546eb46375b1d 100644 (file)
@@ -1,13 +1,3 @@
 diff -Naur xen/core/devmem.c xen.patched/core/devmem.c
 --- xen/core/devmem.c  2005-09-23 10:54:50.000000000 -0600
 +++ xen.patched/core/devmem.c  2005-09-23 10:57:51.000000000 -0600
-@@ -93,6 +93,9 @@
-       if (uncached_access(file))
-               vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-+#ifdef __ia64__
-+#define       direct_remap_pfn_range(a,b,c,d,e,f)     remap_pfn_range(a,b,c,d,e)
-+#endif
-       if (direct_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
-                                  vma->vm_end - vma->vm_start,
-                                  vma->vm_page_prot, DOMID_IO))
index 84d89e1825668721cdc16763d2f16c9291701e5a..90272db1f4197df1917fed9b059642e05dee4c34 100644 (file)
@@ -1,17 +1,6 @@
 diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c
 --- xen/core/gnttab.c  2005-09-23 10:54:50.000000000 -0600
 +++ xen.patched/core/gnttab.c  2005-09-23 10:57:51.000000000 -0600
-@@ -19,6 +19,10 @@
- #include <asm-xen/gnttab.h>
- #include <asm/synch_bitops.h>
-+#ifdef __ia64__
-+#define synch_cmpxchg ia64_cmpxchg4_acq
-+#endif
-+
- #if 1
- #define ASSERT(_p)                                                          \
-       if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \
 @@ -346,6 +350,10 @@
        if ( hypercall.op != __HYPERVISOR_grant_table_op )
                return -ENOSYS;
@@ -43,17 +32,6 @@ diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c
                set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT);
 +#endif
  
-       return 0;
- }
-@@ -434,8 +448,10 @@
- {
-       int i;
-+#ifndef __ia64__
-       for (i = 0; i < NR_GRANT_FRAMES; i++)
-               clear_fixmap(FIX_GNTTAB_END - i);
-+#endif
        return 0;
  }
 @@ -450,7 +466,9 @@
index cce9fec2fc478ae7d51def57d4dd69581c9c64f9..347ffa792d3a249273d9573beaa6b42c0eabc3f7 100644 (file)
@@ -1,16 +1,6 @@
 diff -Naur xen/privcmd/privcmd.c xen.patched/privcmd/privcmd.c
 --- xen/privcmd/privcmd.c      2005-09-23 10:54:50.000000000 -0600
 +++ xen.patched/privcmd/privcmd.c      2005-09-23 10:57:51.000000000 -0600
-@@ -134,6 +134,9 @@
-                                   > vma->vm_end )
-                                       return -EINVAL;
-+#ifdef __ia64__
-+#define       direct_remap_pfn_range(a,b,c,d,e,f) remap_pfn_range(a,b,c,d,e)
-+#endif
-                               if ((rc = direct_remap_pfn_range(
-                                       vma,
-                                       msg[j].va&PAGE_MASK, 
 @@ -180,6 +183,15 @@
                for (i = 0; i < m.num; i++, addr += PAGE_SIZE, p++) {
                        if (get_user(mfn, p))
index 13b8320ccf3ca6664e8cb7bb0599c8bb4fd43302..215804538c8dee561a395c00e8f91dddaa7c361d 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
+#include <asm/hypervisor.h>
 
 static inline int uncached_access(struct file *file)
 {
index c9d812695ef45530a24043ab175b5405a3cd279b..3f9e90cfa8234e546b9448843ad575410f476e07 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/spinlock.h>
 #include <asm-xen/balloon.h>
+#include <asm/hypervisor.h>
 #include "common.h"
 
 /*
@@ -494,6 +495,9 @@ static int __init blkif_init(void)
        int i;
        struct page *page;
 
+       if (xen_init() < 0)
+               return -ENODEV;
+
        blkif_interface_init();
 
        page = balloon_alloc_empty_page_range(MMAP_PAGES);
index 671f16038cc57747753c48c65ea583e34b935f69..00f3674f735834a033cccbd89b05e7aa09660572 100644 (file)
@@ -49,6 +49,7 @@
 #include <asm-xen/xenbus.h>
 #include <asm-xen/xen-public/grant_table.h>
 #include <asm-xen/gnttab.h>
+#include <asm/hypervisor.h>
 
 #define BLKIF_STATE_DISCONNECTED 0
 #define BLKIF_STATE_CONNECTED    1
@@ -727,6 +728,9 @@ static struct xenbus_driver blkfront = {
 
 static int __init xlblk_init(void)
 {
+       if (xen_init() < 0)
+               return -ENODEV;
+
        xenbus_register_driver(&blkfront);
        return 0;
 }
index 1a23f4495e1bb08bc313ddf05ece2aab6c67d62d..6da5d9159c00052215d180ce459bd5dbde070e12 100644 (file)
@@ -196,6 +196,9 @@ static int __init xen_console_init(void)
 void xen_console_init(void)
 #endif
 {
+       if (xen_init() < 0)
+               return __RETCODE;
+
        if (xen_start_info->flags & SIF_INITDOMAIN) {
                if (xc_mode == XC_DEFAULT)
                        xc_mode = XC_SERIAL;
index db954ca76856f0c282e44596827e3276e3745c95..8a9e295651e298aa59e66ff2210fa5acef48c430 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/pagemap.h>
 #include <linux/seq_file.h>
 #include <linux/kthread.h>
+#include <asm/hypervisor.h>
 
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
index 40a8c178f10d9e85a2873c83247c3f2fe553f408..4b32a8298017e8001dc7a9afbc0b11b530f3c470 100644 (file)
@@ -1 +1,2 @@
-/* empty */
+#define clear_fixmap(x)        do {} while (0)
+#define        set_fixmap(x,y) do {} while (0)
index 9ad2d1f390b9158703971c80246cff1b2ea26331..ee1330659cb419079f0364da96a643ff2fd79931 100644 (file)
@@ -51,6 +51,8 @@ static __inline__ int synch_var_test_bit(int nr, volatile void * addr)
     return test_bit(nr, addr);
 }
 
+#define synch_cmpxchg  ia64_cmpxchg4_acq
+
 #define synch_test_bit(nr,addr) \
 (__builtin_constant_p(nr) ? \
  synch_const_test_bit((nr),(addr)) : \